#ifndef DETECTOROBJECT_H
#define DETECTOROBJECT_H

#include <QObject>
#include "detector_global.h"
#include "detectorinterface.h"
class QThread;

class DetectorObject : public QObject
{
    Q_OBJECT
public:
    explicit DetectorObject(QObject *parent = 0);
    ~DetectorObject();

    ushort *getImage(ushort *&imgPtr, int &width, int &height);

signals:
    void deviceStatus(DetectorState detState, const QString &msg = "");

public slots:
    virtual void initDetector() { emit deviceStatus(DetInitFailed, tr("Null detector.")); }
    virtual void freeDetector() { clearImageBuf(); emit deviceStatus(DetFreed); }
    virtual void startCapture(bool /*start*/) {emit deviceStatus(DetCaptureStartFailed, tr("Null detector.")); }
    void clearImageBuf() { delete[] imgBuf; imgBuf = 0; }

protected:
    ushort *imgBuf;
    ulong imgWidth;
    ulong imgHeight;
};

#endif // DETECTOROBJECT_H
